package cn.rentaotao.spring.data;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.springframework.lang.NonNull;

import java.util.Date;

/**
 * @author rtt
 * @date 2022/5/11 15:51
 */
public class Spittle {

    private Integer id;

    private String message;

    private Date time;

    public Spittle() {
    }

    public Spittle(String message, Date time) {
        this.message = message;
        this.time = time;
    }

    public Spittle(Integer id, String message, Date time) {
        this.id = id;
        this.message = message;
        this.time = time;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this, "id", "time");
    }

    @Override
    public boolean equals(Object that) {
        if (that == null || !that.getClass().equals(Spittle.class)) {
            return false;
        }
        return EqualsBuilder.reflectionEquals(this, that, "id", "time");
    }
}
